﻿<%@ Page Title="" Language="C#" ViewModel="ASP.MVVM.ViewModel.LoginViewModel" %>

<%@ Import Namespace="Nomad.ASPMVVM" %>

<script runat="server">
    private BindingProperty UsernameProperty = new BindingProperty { Property = "Text", Path = "Username" };
    private BindingProperty PasswordProperty = new BindingProperty { Property = "Text", Path = "Password" };
    private BindingProperty AlertVisibleProperty = new BindingProperty { Property = "Visible", Path = "AlertVisible" };

    private BindingProperty AuthenticateCommand = new BindingProperty { Path = "Authenticate", IsCommand = true };
</script>

<asp:Content ContentPlaceHolderID="headPlaceHolder" runat="server">
</asp:Content>
<asp:Content ContentPlaceHolderID="contentPlaceHolder" runat="server">
    <fieldset>
        <legend>Welcome</legend>
        <div>
            <label for="usernameTextBox">Username</label>
            <asp:TextBox runat="server" ID="usernameTextBox" Binding='<%# Eval(UsernameProperty) %>' />
        </div>
        <div>
            <label for="passwordTextBox">Password</label>
            <asp:TextBox runat="server" ID="passwordTextBox" TextMode="Password" Binding='<%# Eval(PasswordProperty) %>' />
        </div>
        <div>
            <asp:Button Text="Send" runat="server" UseSubmitBehavior="true" Binding='<%# Eval(AuthenticateCommand) %>' />
        </div>
    </fieldset>
    <p>
        <asp:Label Text="Access Denied!" runat="server" ForeColor="Red" Visible="false" Binding='<%# Eval(AlertVisibleProperty) %>' />
    </p>
</asp:Content>
